using UnityEngine;
using UnityEngine.Events;

public abstract class BaseImpactEffect : IImpactEffect
{
    public SkillData skillData;
    public GameObject skillObject;

    public abstract void EndEffect();

    public abstract void Execute(SkillDeployer baseDeployer);

    public virtual void OnImpactTriggerEntry(Collider2D collision) { }
    public virtual void OnImpactTriggerExit(Collider2D collision) { }

    void AddUpdateEvent(UnityAction action)
    {
        MonoManager.Instance.AddUpdateEvent(action);
    }

    void RemoveUpdateEvent(UnityAction action)
    {
        MonoManager.Instance.RemoveUpdateEvent(action);
    }


    #region 简写
    public Character OwnerEntity => skillData.owner.GetComponent<Character>();
    public Vector3 OwnerPos => skillData.owner.transform.position;
    public float OwnerDamage => OwnerEntity.stats.damage.GetValue();
    #endregion
}